package utils

import "encoding/json"

type byOS map[string]byArch
type byArch map[string]byDistribution
type byDistribution map[string]map[string]string

func GetRemoteJdkVersion(os, arch string) map[string]string {
	content, err := Fetch(RemoteJdkManageUrl)
	if err != nil {
	}
	var index byOS
	err = json.Unmarshal(content, &index)
	if err != nil {
	}
	releaseMap := make(map[string]string)
	for key, value := range index[os][arch] {
		for key1, value1 := range value {
			releaseMap[key+key1] = value1
		}
	}
	return releaseMap
}
